]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tools/shell-lg: Stop leaking inspector
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 3 Sep 2026 17:46:07 +0000 (19:46 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 17:39:10 +0000 (19:39 +0200)
We currently don't destroy inspectors that we create, so we leak
both the actor and the associated signalTracker.

There is no need to track signals separately, just destroy the actor
when we are done.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4381>
(cherry picked from commit 14045490c7e523f42a476cfeb033f35465383fb4)

tools/shell-lg.sh

index ae64ca3df7373c0422bd0413ff4e663aaf48d401..65d2b8cc0cf0aebdf94b1458a71ac010c8702376 100755 (executable)
@@ -235,13 +235,14 @@ inspect() {
   Main.lookingGlass._inspector = new LookingGlass.Inspector(Main.lookingGlass);
   const inspector = Main.lookingGlass._inspector;
 
-  inspector.connectObject("target", (i, obj, stageX, stageY) => {
+  inspector.connect("target", (i, obj, stageX, stageY) => {
     let command = "inspect(" + Math.round(stageX) + ", " + Math.round(stageY) + ")";
     Main.lookingGlass._lastInspection = command;
-  },
-"closed", () => {
-  delete Main.lookingGlass._inspector;
-});
+  });
+  inspector.connect("closed", () => {
+    Main.lookingGlass._inspector.destroy();
+    delete Main.lookingGlass._inspector;
+  });
 `;
 AsyncFunction(command)();
 '